
// 403d7ddb22b287de8500188b77163b48.png
var request = require('request');
var fs = require('fs');

var data = fs.readFileSync('./src/assets/style.css', 'utf8');

console.log(data);

var rg = /\"..\/files\/.*\"/g


var re = data.toString().match(rg);

console.log(re);

re.forEach( s => {
  var path = s.substr(1, s.length-2);
  var name = path.split('/').pop();
  var url = 'http://www.jiakaobaodian.com/core-assets/jiakao/application/mnks/exam/files/' + name;
  console.log('load Url : ',url);
  request(url).pipe(fs.createWriteStream('./src/files/'+ name));
})
